import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '用户ID',
    align: "center",
    dataIndex: 'id'
  }, {
    title: '用户姓名',
    align: "center",
    dataIndex: 'realname'
  }, {
    title: '手机号',
    align: "center",
    dataIndex: 'phone'
  },
  {
    title: '三级权益包',
    align: "center",
    dataIndex: 'threeEquity'
  },
  {
    title: '二级权益包',
    align: "center",
    dataIndex: 'towEquity'
  },

  {
    title: '一级权益包',
    align: "center",
    dataIndex: 'oneEquity'
  },


  {
    title: '特级权益包',
    align: "center",
    dataIndex: 'maxEquity'
  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "对应账号ID",
    field: 'userId',
    component: 'JSearchSelect',
    componentProps: {
      dict: "sys_user where user_type = 1,realname,id"
    },
    //colProps: {span: 6},
  },
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '用户名称',
    field: 'name',
    component: 'Input',
  },
  {
    label: '对应账号ID',
    field: 'userId',
    component: 'JSearchSelect',
    componentProps: {
      dict: "sys_user where user_type = 1,realname,id"
    },
  },
  {
    label: '积分',
    field: 'points',
    component: 'InputNumber',
  },
  {
    label: '0普通 1vip 2员工 3领班 4店长 5经理 6总监 7董事',
    field: 'grade',
    component: 'Input',
  },
  {
    label: '用户手机号',
    field: 'phone',
    component: 'Input',
  },
  // TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false
  },
];

// 高级查询数据
export const superQuerySchema = {
  name: { title: '用户名称', order: 0, view: 'text', type: 'string', },
  userId: { title: '对应账号ID', order: 1, view: 'sel_search', type: 'string', dictTable: "sys_user where user_type = 1", dictCode: 'id', dictText: 'realname', },
  points: { title: '积分', order: 2, view: 'number', type: 'number', },
  grade: { title: '0普通 1vip 2员工 3领班 4店长 5经理 6总监 7董事', order: 3, view: 'text', type: 'string', },
  phone: { title: '用户手机号', order: 4, view: 'text', type: 'string', },
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[] {
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}